package com.boil.qz.safekavass.weixin.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-07-10.
 * <br>
 * 绑定手机号的请求参数。
 */
public class BindPhoneParam {
    /**
     * openid
     */
    @NotBlank(message = "openid不能为空")
    @Length(min = Constants.VALUE_1, max = Constants.VALUE_100, message = "openid的长度在1至100个字之间")
    private String openid;
    /**
     * 手机号
     */
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = Constants.PHONE_RE, message = Constants.PHONE_RE_MSG)
    private String phone;
    /**
     * 重定向 URL
     */
    @NotBlank(message = "重定向URL不能为空")
    private String redirectUrl;

    /**
     * 默认构造器。
     */
    public BindPhoneParam() {
        super();
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRedirectUrl() {
        return redirectUrl;
    }

    public void setRedirectUrl(String redirectUrl) {
        this.redirectUrl = redirectUrl;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("BindPhoneParam{");
        sb.append("openid='").append(openid).append('\'');
        sb.append(", phone='").append(phone).append('\'');
        sb.append(", redirectUrl='").append(redirectUrl).append('\'');
        sb.append('}');
        return sb.toString();
    }
}